package cn.tworice.blog.ws;

import javax.servlet.http.HttpSession;
import javax.websocket.HandshakeResponse;
import javax.websocket.server.HandshakeRequest;
import javax.websocket.server.ServerEndpointConfig;

public class GetHttpSessionConfig extends ServerEndpointConfig.Configurator {
//    @Override
//    public void modifyHandshake(ServerEndpointConfig sec, HandshakeRequest request, HandshakeResponse response) {
//        // 获取HttpSession对象
//        HttpSession httpSession = (HttpSession) request.getHttpSession();
//
//        if(httpSession !=null){
//            // 将httpSession对象存储到配置对象中
//            sec.getUserProperties().put(HttpSession.class.getName(),httpSession);
//        }
//
//    }
}
